import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'index',
            redirect: "/login",
            children: [
                {
                    path: '/login',
                    name: 'login',
                    component: () => import('../views/LoginView.vue')
                },
                {
                    path: '/register',
                    name: 'register',
                    component: () => import('../views/RegisterView.vue')
                },
            ]
        },
        {
            path: '/home',
            name: 'home',
            redirect: "/home/welcome",
            component: () => import('../views/HomeView.vue'),
            children: [
                {
                    path: '/home/welcome',
                    name: 'welcome',
                    component: () => import('../views/WelcomeView.vue')
                }, {
                    path: '/home/device',
                    name: 'device',
                    component: () => import('../views/DeviceView.vue')
                }, {
                    path: '/home/device/edit',
                    name: 'deviceEdit',
                    component: () => import('../views/DeviceEditView.vue')
                }, {
                    path: '/home/real',
                    name: 'real',
                    component: () => import('../views/RealView.vue')
                }, {
                    path: '/home/user',
                    name: 'user',
                    component: () => import('../views/UserView.vue')
                }, {
                    path: '/home/user/edit',
                    name: 'userEdit',
                    component: () => import('../views/UserEditView.vue')
                }, {
                    path: '/home/capture',
                    name: 'capture',
                    component: () => import('../views/CaptureView.vue')
                }, {
                    path: '/home/video',
                    name: 'video',
                    component: () => import('../views/VideoView.vue')
                }, {
                    path: '/home/video/detail',
                    name: 'videoDetail',
                    component: () => import('../views/VideoDetailView.vue')
                }, {
                    path: '/home/log',
                    name: 'log',
                    component: () => import('../views/SysLogView.vue')
                }
            ]
        },
    ]
})

export default router
